package org.ds.blog.controller;

import org.ds.blog.model.Response;
import org.ds.blog.model.User;
import org.ds.blog.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@RestController
@RequestMapping(value = "/user",produces = "application/json")
public class LoginController {
    @Resource
    UserService userService;
    public Response login(@Valid @RequestBody User user) {
        User userByUsername = userService.findUserByUsername(user.getUsername());
        if (user.getPassword().equals(userByUsername.getPassword())) {

        }
    }
}
